import React from 'react';
import { HashRouter, Route, Switch, Redirect } from 'react-router-dom';
import App from './App';
import Admin from "./admin";
import Login from "./pages/login";
import Buttons from "./pages/ui/buttons";
import NoMatch from "./pages/no_match";
import Modals from "./pages/ui/modals";
import Loadings from "./pages/ui/loading";
import Notice from "./pages/ui/notice/notice";
import Message from "./pages/ui/messages";
import Tabs1 from "./pages/ui/tabs";
import Gallery from "./pages/ui/gallery";
import Carousels from "./pages/ui/carousel";
import FormLogin from "./pages/form/login";
import FormRegister from "./pages/form/register";
import FormOther from './pages/form/other';


import Basic from "./pages/table/basicTable";
import High from "./pages/table/highTable";
import EditableTable from "./pages/table/edit_table";

import City from "./pages/city";

export default class IRouter extends React.Component {
	render() {
		return (
			<HashRouter>
				<App>
					<Switch>
						<Redirect from="/" exact to='/admin' />
						<Route path='/login' component={Login} />
						<Route path='/admin' render={() => (
							<Admin>
								<Switch>
									<Route path='/admin/ui/buttons' component={Buttons} />
									<Route path='/admin/ui/modals' component={Modals} />
									<Route path='/admin/ui/loadings' component={Loadings} />
									<Route path='/admin/ui/notification' component={Notice} />
									<Route path='/admin/ui/messages' component={Message} />
									<Route path='/admin/ui/tabs' component={Tabs1} />
									<Route path='/admin/ui/gallery' component={Gallery} />
									<Route path='/admin/ui/carousel' component={Carousels} />

									<Route path='/admin/form/login' component={FormLogin} />
									<Route path='/admin/form/reg' component={FormRegister} />
									<Route path='/admin/form/other' component={FormOther} />

									<Route path='/admin/table/basic' component={Basic} />
									<Route path='/admin/table/high' component={High} />
									<Route path='/admin/table/edit' component={EditableTable} />

									<Route path='/admin/city' component={City} />

									<Route component={NoMatch} />
								</Switch>
							</Admin>
						)} />
						<Route path='/order/detail' component={Login} />
					</Switch>
				</App>
			</HashRouter>
		)
	}
}
